fetcher: set timeouts on HTTP connections
authorDaniel Drake <drake@endlessm.com>
Thu, 13 Feb 2014 16:57:10 +0000 (10:57 -0600)
committerDaniel Drake <drake@endlessm.com>
Thu, 13 Feb 2014 17:21:26 +0000 (11:21 -0600)
We're seeing some hangs while ostree is fetching updates.
I imagine the fact that SoupSessionAsync has no timeout by default
could be the cause of this.

Set timeout values to 60 seconds, which is the default for the new
SoupSession API which we may switch to later.

https://bugzilla.gnome.org/show_bug.cgi?id=724310

src/libostree/ostree-fetcher.c

index ec3b519e270f747daa9f3d1a625fa372f9cd51dd..6b55378fa6b516adb18c210b2239271fcac2e474 100644 (file)
@@ -153,6 +153,8 @@ ostree_fetcher_init (OstreeFetcher *self)
                                                        SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE, TRUE,
                                                        SOUP_SESSION_USE_THREAD_CONTEXT, TRUE,
                                                        SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_REQUESTER,
+                                                       SOUP_SESSION_TIMEOUT, 60,
+                                                       SOUP_SESSION_IDLE_TIMEOUT, 60,
                                                        NULL);
   self->requester = (SoupRequester *)soup_session_get_feature (self->session, SOUP_TYPE_REQUESTER);
   g_object_get (self->session, "max-conns-per-host", &max_conns, NULL);